(function(global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('hy5b/log')) :
    typeof define === 'function' && define.amd ? define(['hy5b/log/index'], factory) :
    global.log = factory(log);
}(this, function(log) {

  var pool = {};
  var i = 0;

  //我种下一颗种子
  //设置种子编号
  log.seed = function(num) {
    i++;
    pool[num] = {
      i: i,
      ts: Date.now()
    };
    var args = Array.prototype.slice.call(arguments);
    args = ['seed', i + 'th', num].concat(args.slice(0));
    log.call(this, args);
  }

  //终于长出了果实，需要种子编号
  //获得成长时间
  log.reap = function(num) {
    var now = Date.now();
    var seed = pool[num];
    var args = Array.prototype.slice.call(arguments);
    args = ['reap', seed.i + 'th', num, '(+' + (now - seed.ts) + 'ms)'].concat(args.slice(0));
    log.call(this, args);
    seed.ts = now;
  }

  return log;

}))
